﻿/*----------------------------------------------------------------
// 公司名称：公司名称
// 
// 产品名称：Gaf
//
// 创 建 人：netcasewqs
// 创建日期：2022/3/4
// 邮    箱：netcasewqs@qq.com
//
// Copyright (C) 2022 Gaf，保留所有权利。
//
//----------------------------------------------------------------*/

namespace Gaf;

/// <summary>
/// 
/// </summary>
[Serializable]
public class AddinException : Exception
{
    /// <summary>
    /// 
    /// </summary>
    public IAddin? Addin { get; internal set; }
    /// <summary>
    ///  获取Addin的异常类型
    /// </summary>
    public AddinExceptionType Type { get; private set; }
    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="type">类型</param>
    /// <param name="message">消息</param>
    /// <param name="innerException">异常对象</param>
    public AddinException(AddinExceptionType type = AddinExceptionType.Unspecified, string? message = null, Exception? innerException = null)
        : base(message, innerException)
    {
        Type = type;
    }

    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="message">消息</param>
    /// <param name="innerException">异常对象</param>
    public AddinException(string? message = null, Exception? innerException = null)
        : this(AddinExceptionType.Unspecified, message, innerException)
    {
    }
}


